/**
 * 全局Loading
 */

export const useLoading = createGlobalState(() => {
  const loading = ref(false)
  return { loading }
})

const { loading } = useLoading()

export const openLoading = () => {
  loading.value = true
}

export const closeLoading = () => {
  loading.value = false
}
